Optimal. Leaf size=141 \[ \frac {5 x}{32 a^3}+\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2}-\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 141, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3568, 46, 212}
\begin {gather*} -\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}+\frac {5 x}{32 a^3}+\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 46
Rule 212
Rule 3568
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{(a+i a \tan (c+d x))^3} \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {1}{(a-x)^2 (a+x)^5} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \left (\frac {1}{32 a^5 (a-x)^2}+\frac {1}{4 a^2 (a+x)^5}+\frac {1}{4 a^3 (a+x)^4}+\frac {3}{16 a^4 (a+x)^3}+\frac {1}{8 a^5 (a+x)^2}+\frac {5}{32 a^5 \left (a^2-x^2\right )}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2}-\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}-\frac {(5 i) \text {Subst}\left (\int \frac {1}{a^2-x^2} \, dx,x,i a \tan (c+d x)\right )}{32 a^2 d}\\ &=\frac {5 x}{32 a^3}+\frac {i a}{16 d (a+i a \tan (c+d x))^4}+\frac {i}{12 d (a+i a \tan (c+d x))^3}+\frac {3 i}{32 a d (a+i a \tan (c+d x))^2}-\frac {i}{32 d \left (a^3-i a^3 \tan (c+d x)\right )}+\frac {i}{8 d \left (a^3+i a^3 \tan (c+d x)\right )}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.34, size = 115, normalized size = 0.82 \begin {gather*} \frac {\sec ^3(c+d x) (-180 \cos (c+d x)+20 i (i+6 d x) \cos (3 (c+d x))+9 \cos (5 (c+d x))-60 i \sin (c+d x)+20 i \sin (3 (c+d x))-120 d x \sin (3 (c+d x))+15 i \sin (5 (c+d x)))}{768 a^3 d (-i+\tan (c+d x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.29, size = 102, normalized size = 0.72
method | result | size |
risch | \(\frac {5 x}{32 a^{3}}+\frac {5 i {\mathrm e}^{-4 i \left (d x +c \right )}}{64 a^{3} d}+\frac {5 i {\mathrm e}^{-6 i \left (d x +c \right )}}{192 a^{3} d}+\frac {i {\mathrm e}^{-8 i \left (d x +c \right )}}{256 a^{3} d}+\frac {9 i \cos \left (2 d x +2 c \right )}{64 a^{3} d}+\frac {11 \sin \left (2 d x +2 c \right )}{64 a^{3} d}\) | \(97\) |
derivativedivides | \(\frac {-\frac {5 i \ln \left (\tan \left (d x +c \right )-i\right )}{64}+\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {3 i}{32 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{12 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {1}{8 \tan \left (d x +c \right )-8 i}+\frac {5 i \ln \left (\tan \left (d x +c \right )+i\right )}{64}+\frac {1}{32 \tan \left (d x +c \right )+32 i}}{d \,a^{3}}\) | \(102\) |
default | \(\frac {-\frac {5 i \ln \left (\tan \left (d x +c \right )-i\right )}{64}+\frac {i}{16 \left (\tan \left (d x +c \right )-i\right )^{4}}-\frac {3 i}{32 \left (\tan \left (d x +c \right )-i\right )^{2}}-\frac {1}{12 \left (\tan \left (d x +c \right )-i\right )^{3}}+\frac {1}{8 \tan \left (d x +c \right )-8 i}+\frac {5 i \ln \left (\tan \left (d x +c \right )+i\right )}{64}+\frac {1}{32 \tan \left (d x +c \right )+32 i}}{d \,a^{3}}\) | \(102\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.36, size = 76, normalized size = 0.54 \begin {gather*} \frac {{\left (120 \, d x e^{\left (8 i \, d x + 8 i \, c\right )} - 12 i \, e^{\left (10 i \, d x + 10 i \, c\right )} + 120 i \, e^{\left (6 i \, d x + 6 i \, c\right )} + 60 i \, e^{\left (4 i \, d x + 4 i \, c\right )} + 20 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + 3 i\right )} e^{\left (-8 i \, d x - 8 i \, c\right )}}{768 \, a^{3} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.28, size = 224, normalized size = 1.59 \begin {gather*} \begin {cases} \frac {\left (- 100663296 i a^{12} d^{4} e^{22 i c} e^{2 i d x} + 1006632960 i a^{12} d^{4} e^{18 i c} e^{- 2 i d x} + 503316480 i a^{12} d^{4} e^{16 i c} e^{- 4 i d x} + 167772160 i a^{12} d^{4} e^{14 i c} e^{- 6 i d x} + 25165824 i a^{12} d^{4} e^{12 i c} e^{- 8 i d x}\right ) e^{- 20 i c}}{6442450944 a^{15} d^{5}} & \text {for}\: a^{15} d^{5} e^{20 i c} \neq 0 \\x \left (\frac {\left (e^{10 i c} + 5 e^{8 i c} + 10 e^{6 i c} + 10 e^{4 i c} + 5 e^{2 i c} + 1\right ) e^{- 8 i c}}{32 a^{3}} - \frac {5}{32 a^{3}}\right ) & \text {otherwise} \end {cases} + \frac {5 x}{32 a^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.81, size = 119, normalized size = 0.84 \begin {gather*} -\frac {-\frac {60 i \, \log \left (-i \, \tan \left (d x + c\right ) + 1\right )}{a^{3}} + \frac {60 i \, \log \left (-i \, \tan \left (d x + c\right ) - 1\right )}{a^{3}} - \frac {12 \, {\left (5 \, \tan \left (d x + c\right ) + 7 i\right )}}{a^{3} {\left (i \, \tan \left (d x + c\right ) - 1\right )}} + \frac {-125 i \, \tan \left (d x + c\right )^{4} - 596 \, \tan \left (d x + c\right )^{3} + 1110 i \, \tan \left (d x + c\right )^{2} + 996 \, \tan \left (d x + c\right ) - 405 i}{a^{3} {\left (\tan \left (d x + c\right ) - i\right )}^{4}}}{768 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.68, size = 124, normalized size = 0.88 \begin {gather*} \frac {5\,x}{32\,a^3}+\frac {\frac {1}{3\,a^3}+\frac {35\,{\mathrm {tan}\left (c+d\,x\right )}^2}{96\,a^3}-\frac {5\,{\mathrm {tan}\left (c+d\,x\right )}^4}{32\,a^3}+\frac {\mathrm {tan}\left (c+d\,x\right )\,5{}\mathrm {i}}{32\,a^3}+\frac {{\mathrm {tan}\left (c+d\,x\right )}^3\,15{}\mathrm {i}}{32\,a^3}}{d\,\left (-{\mathrm {tan}\left (c+d\,x\right )}^5+{\mathrm {tan}\left (c+d\,x\right )}^4\,3{}\mathrm {i}+2\,{\mathrm {tan}\left (c+d\,x\right )}^3+{\mathrm {tan}\left (c+d\,x\right )}^2\,2{}\mathrm {i}+3\,\mathrm {tan}\left (c+d\,x\right )-\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________